package com.qianniu.napi.admin.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 交易流水表
 * </p>
 *
 * @author chenxuebin
 * @since 2018-07-07
 */
@TableName("t_account_flow")
public class AccountFlow extends Model<AccountFlow> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 流水号
     */
    private String sn;
    @JsonIgnore
    private Long uid;
    @JsonIgnore
    private Long mid;
    @JsonIgnore
    private Long mpid;
    @JsonIgnore
    private Long sid;
    @JsonIgnore
    private Long leagueid;
    @JsonIgnore
    private Long modifier;

    /**
     * 金额
     */
    private BigDecimal amount;
    //	private BigDecimal mamount;
    private BigDecimal dikou;
    private BigDecimal discount;
    private BigDecimal realpay;
    private BigDecimal total;
    private BigDecimal lasttotal;
    private BigDecimal lastamount;

    /**
     * 1：已入账；0：待入账
     */
    @TableField("is_confirm")
    private Integer isConfirm;

    private Integer ruzhang;

    /**
     * 返佣入账类型@1：支付成功后；2：确认收货|扫码核销后；3：发货15天后到账
     */
    @TableField("fantime_type")
    private Integer fantimeType;

    /**
     * 待入账日期
     */
    @TableField("confirm_date")
    private Date confirmDate;

    /**
     * 进账类型@1：入账，充值，赚佣金；-1：出帐，消费，提醒
     */
    private Integer iotype;

    /**
     * 消费类型@1：充值；2：提现；3：赚佣金；4：消费；5：赠送金额；6：扣款；
     */
    private Integer xftype;

    private Integer state;

    private String xftypename;

    /**
     * 摘要
     */
    private String remark;
    private String origin;
    private String transactionid;

    /**
     * 交易时间
     */
    private Date tradetime;

    private String nickname;
    private String phone;
    private String headimg;

    @JsonIgnore
    private Date createtime;
    @JsonIgnore
    private Date modifytime;

    public Long getMpid() {
        return mpid;
    }

    public void setMpid(Long mpid) {
        this.mpid = mpid;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public Long getUid() {
        return uid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public Long getMid() {
        return mid;
    }

    public void setMid(Long mid) {
        this.mid = mid;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getDikou() {
        return dikou;
    }

    public void setDikou(BigDecimal dikou) {
        this.dikou = dikou;
    }

    public BigDecimal getRealpay() {
        return realpay;
    }

    public void setRealpay(BigDecimal realpay) {
        this.realpay = realpay;
    }

    public Integer getIsConfirm() {
        return isConfirm;
    }

    public void setIsConfirm(Integer isConfirm) {
        this.isConfirm = isConfirm;
    }

    public Date getConfirmDate() {
        return confirmDate;
    }

    public void setConfirmDate(Date confirmDate) {
        this.confirmDate = confirmDate;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getIotype() {
        return iotype;
    }

    public void setIotype(Integer iotype) {
        this.iotype = iotype;
    }

    public Integer getXftype() {
        return xftype;
    }

    public void setXftype(Integer xftype) {
        this.xftype = xftype;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getTradetime() {
        return tradetime;
    }

    public void setTradetime(Date tradetime) {
        this.tradetime = tradetime;
    }

    public String getOrigin() {
        return origin;
    }

    public void setOrigin(String origin) {
        this.origin = origin;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Date getModifytime() {
        return modifytime;
    }

    public void setModifytime(Date modifytime) {
        this.modifytime = modifytime;
    }

    public Long getModifier() {
        return modifier;
    }

    public void setModifier(Long modifier) {
        this.modifier = modifier;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    //    public String getNickname() {
//        if (remark != null && remark.split("|").length >= 3) {
//            nickname = remark.split("|")[1];
//        }
//        return nickname;
//    }

//    public String getAvatar() {
//        if (remark != null && remark.split("|").length >= 3) {
//            nickname = remark.split("|")[2];
//        }
//        return avatar;
//    }

    public String getTransactionid() {
        return transactionid;
    }

    public void setTransactionid(String transactionid) {
        this.transactionid = transactionid;
    }

    public Integer getFantimeType() {
        return fantimeType;
    }

    public void setFantimeType(Integer fantimeType) {
        this.fantimeType = fantimeType;
    }

    public BigDecimal getTotal() {
        return total;
    }

    public void setTotal(BigDecimal total) {
        this.total = total;
    }

    public String getXftypename() {
        return xftypename;
    }

    public void setXftypename(String xftypename) {
        this.xftypename = xftypename;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getHeadimg() {
        return headimg;
    }

    public void setHeadimg(String headimg) {
        this.headimg = headimg;
    }

    public Long getSid() {
        return sid;
    }

    public void setSid(Long sid) {
        this.sid = sid;
    }

    public BigDecimal getLasttotal() {
        return lasttotal;
    }

    public void setLasttotal(BigDecimal lasttotal) {
        this.lasttotal = lasttotal;
    }

    public Integer getRuzhang() {
        return ruzhang;
    }

    public void setRuzhang(Integer ruzhang) {
        this.ruzhang = ruzhang;
    }

    public Long getLeagueid() {
        return leagueid;
    }

    public void setLeagueid(Long leagueid) {
        this.leagueid = leagueid;
    }

    public BigDecimal getLastamount() {
        return lastamount;
    }

    public void setLastamount(BigDecimal lastamount) {
        this.lastamount = lastamount;
    }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "AccountFlow{" +
                "id=" + id +
                ", sn=" + sn +
                ", uid=" + uid +
                ", amount=" + amount +
                ", confirmDate=" + confirmDate +
                ", iotype=" + iotype +
                ", xftype=" + xftype +
                ", remark=" + remark +
                ", tradetime=" + tradetime +
                ", createtime=" + createtime +
                ", modifytime=" + modifytime +
                "}";
    }
}
